/*
 * motor.c
 *
 *  Created on: Sep 13, 2019
 *      Author: ROG
 */

#include "main.h"
#include "can.h"
#include "pid.h"

void MOTOR_SPEED(short speed)
{
	uint8_t data[8];
	data[0] = speed >> 8;
	data[1] = (speed&0xff);
	CAN_Transmit(data);
	return ;
}

uint8_t data[8];

void MOTOR_GET_SPEED(short *speed,uint8_t *id)
{

	CAN_Receive(data, id);
	*speed = (data[2]<<8) | data[3];
	return ;
}



